﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;

namespace QLCHHoaLan
{
    public partial class FrmTimKiemHoa : Form
    {
        public FrmTimKiemHoa()
        {
            InitializeComponent();
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            Menu main = new Menu();
            main.kq = 1;
            main.Show();

            this.Hide();
        }

        private void btnTim_Click(object sender, EventArgs e)
        {

            if (txtTenHoa.Text != "")
            {
                HoaDTO hoa = new HoaDTO();
                hoa.TenHoa = txtTenHoa.Text;

                HoaBUS hoabus = new HoaBUS();
                DataTable dt = new DataTable();

                dt = hoabus.TimKiemHoa(hoa.TenHoa);
                dgvTimKiemHoa.DataSource = hoabus.TimKiemHoa(hoa.TenHoa);

            }
            else {
                MessageBox.Show("Nhập tên hoa");
            }
        }

        private void btnRefresh_Click(object sender, EventArgs e)
        {
            txtTenHoa.Text = null;
        }
    }
}
